<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class MaterialBillChild extends BaseModel
{
    use HasFactory;
    //物料清单字表
    protected $table = 'material_bill_child';
    // 允许批量操作的字段
    protected $fillable = [
        'bill_id',
        'material_id',
        'dosage',
        'created_at',
        'updated_at',
    ];

    public function scopeSearch($query,$params)
    {
        return $query;
    }


    public function material(){
        return $this->hasOne(Material::class,'id','material_id');
    }
}
